#import <Cocoa/Cocoa.h>
#import "RNLayoutView.h"

extern NSString* const RNToolbarFlexibleSpaceButtonIdentifier;

@class RNToolbar;
@class RNToolbarButton;

#pragma mark -
@protocol RNToolbarButtonValidations
-(BOOL)validateToolbarButton:(id <NSValidatedUserInterfaceItem>)button;
@end

#pragma mark -
@protocol RNToolbarDatasource
-(RNToolbarButton *)toolbar:(RNToolbar *)toolbar toolbarButtonForIdentifier:(NSString *)buttonIdentifier;
-(NSArray *)buttonIdentifiersForToolbar:(RNToolbar *)toolbar;
@end


@class RNLayoutPopUpButton;

@interface RNToolbar : RNLayoutView {
  @private
    NSArray *buttons_;
    NSArray *visibleButtons_;
    RNLayoutPopUpButton *overflowButton_;
    BOOL showsTitles_;
    NSObject<RNToolbarDatasource> *delegate_;
    BOOL visibleButtonsNeedUpdate_;
    BOOL needsTile_;
    CGFloat sumButtonWidth_;
    NSToolbarDisplayMode displayMode_;
    NSGradient *backgroundGradient_;
    NSColor *borderColor_;
}

@property (nonatomic, assign) IBOutlet NSObject<RNToolbarDatasource> *delegate;
@property (nonatomic, readonly, retain) NSArray *buttons;
@property (nonatomic, retain) RNLayoutPopUpButton *overflowButton;
@property (nonatomic, assign) BOOL showsTitles;
@property (nonatomic, retain) NSGradient *backgroundGradient;
@property (nonatomic, copy) NSColor *borderColor;

-(void)updateToolbar;
-(void)validateVisibleItems;

@end

